Skip to content

feat(schemavalidators): add optional provenance.trace_discover to AI security context schema - #3638

Merged
migmartri merged 2 commits into
mainfrom
trace-discover-provenance-schema
Oct 16, 2026
Merged

migmartri merged 2 commits into
mainfrom
trace-discover-provenance-schema

Conversation

@migmartri

@migmartri migmartri commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Adds an optional provenance.trace_discover object to the AI security context schema (ai-security-context-0.1).

The producer of a security context looks up, in the Chainloop graph, the AI coding sessions behind fingerprint commits that declare none in a Chainloop-Trace-Sessions trailer. Today the artifact cannot record how that lookup went, so a context whose lookups were all refused looks the same as one for a repository with no AI sessions. Because provenance sets additionalProperties: false, the schema has to allow the field before a producer can write it.

The new object holds:

  • status: ran, disabled, or cli_not_found.
  • commits, matched, not_found, denied, failed: non-negative integer counters. They are required when status is ran and forbidden otherwise (draft-07 if/then/else).

The field is optional, so artifacts without it stay valid and schema_version is unchanged. Validator tests cover the valid and invalid shapes.

This change was produced with AI assistance (Claude Code).

🤖 Posted by Maximus bot (Claude Code) on behalf of @migmartri using the eng-autopilot skill

View guided diff

…security context schema

Record the outcome of the Chainloop graph lookup that resolves fingerprint
commits to AI coding sessions, so a reader can tell 'no AI sessions' apart
from 'the lookup could not run or was refused'. The counters are required
when status is ran and forbidden otherwise. The field is optional, so
existing artifacts stay valid and schema_version is unchanged.

Assisted-by: Claude Code
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>

Chainloop-Trace-Sessions: b0681449-64bf-4654-beb8-c933c3cea0b3
@migmartri
migmartri requested a review from a team October 16, 2026 10:26
@chainloop-platform

chainloop-platform Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

PR validation — ✅ 3 passing

Status Policy Material Messages
✅ Passed pr-min-approvals pr-info -
✅ Passed pr-description-required pr-info -
✅ Passed pr-user-story-linked pr-info -

View attestation ↗

AI Session Checks — 🟢 91% · ✅ 0 failing

Avg score Sessions Failing policies Attribution Files Lines Total Duration
🟢 91% 1 ✅ 0 100% AI / 0% Human 2 +191 / -21 23m6s

🟢 91% — 100% AI — ✅ All policies passing

Oct 16, 2026 10:23 UTC · 23m6s · $6.23 · 224 in / 83.0k out · claude-code 2.1.301 (claude-opus-5-5)

View session details ↗

Change Summary

  • Adds an optional provenance.trace_discover object to the AI security context schema.
  • Enforces status-dependent counter rules for ran, disabled, and cli_not_found.
  • Adds a 15-case validator test for the new field and later refactors that test for lint compliance.

AI Session Overall Score

🟢 91% — Autonomous autopilot run; strong alignment and verification, with no user-trust signal by design.

AI Session Analysis Breakdown

🟢 93% · scope-discipline

🟢 The staged change stayed inside the schema file and its test file. · High Impact

🟢 92% · alignment

No notes.

🟢 91% · verification

🟢 A new 15-case trace_discover test failed first and then passed after the schema fix. · High Impact

🟢 90% · context-and-planning

🟢 The opening brief tightly scoped the exact files, constraints, and workflow requirements. · High Impact

🟢 90% · solution-quality

No notes.

abstained · user-trust-signal

🟡 User trust was not assessed because the session was autopilot instructions plus peer messages, not a human reaction arc. · Low Severity

Missing criteria: user-trust-signal


File Attribution

████████████████████ 100% AI / 0% Human

Status Attribution File Lines
modified ai internal/schemavalidators/schemavalidators_test.go +96 / -21
modified ai internal/schemavalidators/internal_schemas/aisecuritycontext/ai-security-context-0.1.schema.json +95 / -0

Policies (4)

Status Policy Material Messages
✅ Passed ai-config-ai-agents-allowed ai-coding-session-b06814 -
✅ Passed ai-config-no-dangerous-commands ai-coding-session-b06814 -
✅ Passed ai-config-no-secrets ai-coding-session-b06814 -
✅ Passed ai-config-mcp-servers-allowed ai-coding-session-b06814 -

Security Checks — ✅ 6 passing

✅ secret-scan

Status Policy Messages
✅ Passed secrets-detection -

✅ sast-scan

Status Policy Messages
✅ Passed owasp-top10-2025 -
✅ Passed sast -
✅ Passed cwe-top25 -
✅ Passed cwe-top26-40-cusp -

✅ iac-scan

Status Policy Messages
✅ Passed iac-misconfiguration -
Scans not applied (2)
Scan Reason
vulnerability-scan no manifest/lockfile changed
github-actions-scan no workflow files changed

View attestation ↗

Security context

✅ Nothing this change touches has a recorded security-fix history.

View in Chainloop ↗ · How this works ↗


Powered by Chainloop and Chainloop Trace

…tisfy goconst

Assisted-by: Claude Code
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>

Chainloop-Trace-Sessions: b0681449-64bf-4654-beb8-c933c3cea0b3
@migmartri
migmartri marked this pull request as ready for review October 16, 2026 15:55

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

View guided diff | Re-trigger cubic

@migmartri
migmartri merged commit 9a87f5d into main Oct 16, 2026
17 checks passed
@migmartri
migmartri deleted the trace-discover-provenance-schema branch October 16, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants